<template>
	<el-dialog
		title="版本日志"
		:visible.sync="comIsShow"
		width="80%"
		:before-close="cancel"
		modal-append-to-body
		append-to-body
		:close-on-click-modal="false"
		:close-on-press-escape="false"
		top="5vh"
	>
		<div id="ProductInfoVersionLog">
			<div class="logLeft">
				<div
					class="versionActive"
					:class="contentKey === index ? 'activeya' : ''"
					v-for="(item, index) in logData"
					:key="index"
					@click="contentKey = index"
				>
					{{ item.version }}
				</div>
			</div>
			<div class="logRight" v-html="logData[contentKey].content"></div>
		</div>
		<span slot="footer" class="dialog-footer">
			<el-button @click="cancel" size="small" type="primary">关 闭</el-button>
		</span>
	</el-dialog>
</template>
<script>
	import { logData } from './data'
	export default {
		props: {
			comIsShow: {
				type: Boolean,
				default: false
			},
			comIsShowFunc: {
				type: Function,
				default: Function
			}
		},

		data() {
			return {
				logData: logData.reverse(),
				contentKey: 0
			}
		},

		methods: {
			cancel() {
				this.contentKey = 0
				this.$emit('comIsShowFunc')
			}
		}
	}
</script>
<style lang="scss" scoped >
	#ProductInfoVersionLog {
		border: 1px solid #dcdfe6;
		height: 650px;
		display: flex;
		.logLeft {
			width: 20%;
			border-right: 1px solid #dcdfe6;
			height: 650px;
			padding: 20px;
			overflow: auto;
		}
		.logRight {
			width: 80%;
			height: 650px;
			overflow: auto;
			padding: 20px;
		}
		.versionActive {
			width: 100%;
			height: 28px;
			cursor: pointer;
			font-size: 1.1em;
			font-weight: 500;
			color: #2c3e50;
			padding-left: 20px;
			display: flex;
			align-items: center;
			border-left: 4px solid white;
			overflow: hidden;
			text-overflow: ellipsis;
			word-break: keep-all;
			white-space: nowrap;
		}
		.activeya {
			color: #3eaf7c;
			border-left: 4px solid #3eaf7c;
			font-weight: 600;
		}
		/*修改滚动条样式*/
		.logRight::-webkit-scrollbar {
			width: 8px;
			height: 8px;
			/**/
		}
		.logRight::-webkit-scrollbar-track {
			background: rgb(239, 239, 239);
			border-radius: 2px;
		}
		.logRight::-webkit-scrollbar-thumb {
			background: #bfbfbf;
			border-radius: 10px;
		}

		.logRight::-webkit-scrollbar-corner {
			background: #179a16;
		}

		/*修改滚动条样式*/
		.logLeft::-webkit-scrollbar {
			width: 8px;
			height: 8px;
			/**/
		}
		.logLeft::-webkit-scrollbar-track {
			background: rgb(239, 239, 239);
			border-radius: 2px;
		}
		.logLeft::-webkit-scrollbar-thumb {
			background: #bfbfbf;
			border-radius: 10px;
		}

		.logLeft::-webkit-scrollbar-corner {
			background: #179a16;
		}
	}
</style>
